
function butChange(){
	var imgObj = document.getElementById("img_code");
	imgObj.src = "/orderfoodsys/01_image.jsp?id=" + new Date().getTime();
}
document.getElementById("img_code").onclick = function(){
	this.src = "/orderfoodsys/01_image.jsp?id=" + new Date().getTime();
}
document.getElementById("ckNode").onkeyup = function(){
	var oSpan = document.getElementById("sid");
	var val = this.value;
	if(val.length == 4){
		var ajax = creatAJAX();
		var method = "POST";
		var url = "/orderfoodsys/ckCode?time="+new Date().getTime();
		ajax.open(method,url);
		ajax.setRequestHeader("content-type","application/x-www-form-urlencoded");
		// "content-type","application/x-www-urlencoded"
		var content = "code=" + val;
		//真正发送数据
		ajax.send(content);
		//等待
		ajax.onreadystatechange = function(){
			if(ajax.readyState == 4 && ajax.status == 200){
				//接收成功
				var result = ajax.responseText;
				// alert(result);
				if(result == "true"){
					oSpan.innerHTML = "<img src='/orderfoodsys/img/MsgSent.gif' height='30' />";
				}else{
					oSpan.innerHTML = "<img src='/orderfoodsys/img/MsgError.gif' height='30' />";
				}
			}
		}
	}else{
		
	}
	
}
